home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / gfx / pbm / amigasrc.lzh / pnm / Makefile.amiga
Makefile  |  1992-03-19  |  7KB  |  188 lines

  1. # Makefile for pnm tools.
  2. #
  3. # Copyright (C) 1989, 1991 by Jef Poskanzer.
  4. #
  5. # Permission to use, copy, modify, and distribute this software and its
  6. # documentation for any purpose and without fee is hereby granted, provided
  7. # that the above copyright notice appear in all copies and that both that
  8. # copyright notice and this permission notice appear in supporting
  9. # documentation.  This software is provided "as is" without express or
  10. # implied warranty.
  11.  
  12. CC =            dcc
  13. CFLAGS =        -O0 -E DCC_ERRORS -T RAM: -ffp -ms -mu -gs -proto -mRR
  14. SCFLAGS =        -O0 -E DCC_ERRORS -T RAM: -ffp -ms -mu -gs -proto
  15. TIFFDEF =       -DLIBTIFF
  16. TIFFINC =       -I/libtiff
  17. TIFFLIB =       /libtiff/libtiff.lib
  18. TIFFBINARIES =  tifftopnm pnmtotiff
  19. TIFFOBJECTS =   tifftopnm.o pnmtotiff.o
  20. LDFLAGS =
  21. BINDIR  =       bin
  22.  
  23. PPMDIR =        /ppm
  24. INCLUDEPPM =    -I$(PPMDIR)
  25. LIBPPM =        $(PPMDIR)/libppm_sr.lib
  26. LARGELIBPPM =   $(PPMDIR)/libppm_lr.lib
  27. STKLIBPPM =     $(PPMDIR)/libppm_l.lib
  28. DEFPPM =        $(PPMDIR)/ppm.h
  29. DEFLIBPPM =     $(PPMDIR)/libppm.h
  30.  
  31. PGMDIR =        /pgm
  32. INCLUDEPGM =    -I$(PGMDIR)
  33. LIBPGM =        $(PGMDIR)/libpgm_sr.lib
  34. LARGELIBPGM =   $(PGMDIR)/libpgm_lr.lib
  35. STKLIBPGM =     $(PGMDIR)/libpgm_l.lib
  36. DEFPGM =        $(PGMDIR)/pgm.h
  37. DEFLIBPGM =     $(PGMDIR)/libpgm.h
  38.  
  39. PBMDIR =        /pbm
  40. INCLUDEPBM =    -I$(PBMDIR)
  41. LIBPBM =        $(PBMDIR)/libpbm_sr.lib
  42. LARGELIBPBM =   $(PBMDIR)/libpbm_lr.lib
  43. STKLIBPBM =     $(PBMDIR)/libpbm_l.lib
  44. DEFPBM =        $(PBMDIR)/pbm.h /pbmplus.h
  45. DEFLIBPBM =     $(PBMDIR)/libpbm.h
  46.  
  47. INCLUDE =       -I/ $(INCLUDEPPM) $(INCLUDEPGM) $(INCLUDEPBM)
  48. ALLCFLAGS =     $(CFLAGS) $(INCLUDE) $(TIFFDEF) $(TIFFINC)
  49. SALLCFLAGS =     $(SCFLAGS) $(INCLUDE) $(TIFFDEF) $(TIFFINC)
  50. LIBPNM =        libpnm_sr.lib
  51. LARGELIBPNM =   libpnm_lr.lib
  52. STKLIBPNM =     libpnm_l.lib
  53.  
  54. PORTBINARIES =  pnmarith pnmcat pnmconvol pnmcrop pnmcut \
  55.                 pnmdepth pnmenlarge pnmfile pnmflip pnmgamma pnminvert \
  56.                 pnmnoraw pnmpaste pnmtile \
  57.                 pnmtorast pnmtoxwd rasttopnm xwdtopnm
  58. MATHBINARIES =  pnmrotate pnmscale pnmshear pnmtops
  59. BINARIES =      $(PORTBINARIES) $(MATHBINARIES) $(TIFFBINARIES)
  60. SCRIPTS =       anytopnm pnmindex pnmmargin pnmsmooth
  61.  
  62. PORTOBJECTS =   pnmarith.o pnmcat.o pnmconvol.o pnmcrop.o pnmcut.o \
  63.                 pnmdepth.o pnmenlarge.o pnmfile.o pnmflip.o pnminvert.o \
  64.                 pnmnoraw.o pnmpaste.o pnmscale.o pnmtile.o pnmtops.o \
  65.                 pnmtorast.o pnmtoxwd.o rasttopnm.o xwdtopnm.o \
  66.                 pnmgamma.o pnmrotate.o pnmshear.o
  67. OBJECTS =       $(PORTOBJECTS) $(TIFFOBJECTS)
  68.  
  69.  
  70.  
  71. all:            bindir lib binaries
  72.  
  73. bindir:
  74.                 -makedir $(BINDIR)
  75.  
  76. binaries:       $(BINARIES)
  77.  
  78.  
  79.  
  80. # Rules for plain programs.
  81. $(PORTBINARIES):        pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) \
  82.                         $(LIBPNM) $(LIBPPM) $(LIBPGM) $(LIBPBM)
  83.         $(CC) -r $(ALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(LIBPNM) -l $(LIBPPM) -l $(LIBPGM) -l $(LIBPBM)
  84.  
  85. $(TIFFBINARIES):        pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) \
  86.                         $(STKLIBPNM) $(STKLIBPPM) $(STKLIBPGM) $(STKLIBPBM) $(TIFFLIB)
  87.         $(CC) -mD -mC $(SALLCFLAGS) $(LDFLAGS) $@.c -o $(BINDIR)/$@ -l $(STKLIBPNM) -l $(STKLIBPPM) -l $(STKLIBPGM) -l $(STKLIBPBM) -l $(TIFFLIB) -lm
  88.  
  89. # Rule for math-dependent programs.
  90. $(MATHBINARIES):        pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) $(LIBPNM) \
  91.                         $(LIBPPM) $(LIBPGM) $(LIBPBM)
  92.         $(CC) -r $(ALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(LIBPNM) -l $(LIBPPM) -l $(LIBPGM) -l $(LIBPBM) -lm
  93.  
  94. # Rule for objects.
  95. #$(OBJECTS):     pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM)
  96. #        $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c
  97.  
  98. # And libraries.
  99. #$(LIBPBM):
  100. #        cd $(PBMDIR) ; make lib
  101. #$(LIBPGM) FOO:
  102. #        cd $(PGMDIR) ; make lib
  103. #$(LIBPPM) BAR:
  104. #        cd $(PPMDIR) ; make lib
  105. lib:            $(LIBPNM) $(LARGELIBPNM) $(STKLIBPNM)
  106.  
  107. $(LIBPNM):      libpnm1.or libpnm2.or libpnm3.or libpnm4.or
  108.         -delete $(LIBPNM)
  109.         join libpnm1.or libpnm2.or libpnm3.or libpnm4.or to $(LIBPNM)
  110.  
  111. libpnm1.or:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm1.c
  112.         $(CC) $(ALLCFLAGS) -S -o $@ -c libpnm1.c
  113. libpnm2.or:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm2.c $(DEFLIBPPM) \
  114.                 $(DEFLIBPGM) $(DEFLIBPBM)
  115.         $(CC) $(ALLCFLAGS) -S -o $@ -c libpnm2.c
  116. libpnm3.or:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm3.c $(DEFLIBPPM) \
  117.                 $(DEFLIBPGM) $(DEFLIBPBM)
  118.         $(CC) $(ALLCFLAGS) -S -o $@ -c libpnm3.c
  119. libpnm4.or:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) rast.h libpnm4.c
  120.         $(CC) $(ALLCFLAGS) -S -o $@ -c libpnm4.c
  121.  
  122.  
  123. # large data version
  124. $(LARGELIBPNM):      libpnm1.olr libpnm2.olr libpnm3.olr libpnm4.olr
  125.         -delete $(LARGELIBPNM)
  126.         join libpnm1.olr libpnm2.olr libpnm3.olr libpnm4.olr to $(LARGELIBPNM)
  127.  
  128. libpnm1.olr:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm1.c
  129.         $(CC) -mD $(ALLCFLAGS) -S -o $@ -c libpnm1.c
  130. libpnm2.olr:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm2.c $(DEFLIBPPM) \
  131.                 $(DEFLIBPGM) $(DEFLIBPBM)
  132.         $(CC) -mD $(ALLCFLAGS) -S -o $@ -c libpnm2.c
  133. libpnm3.olr:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm3.c $(DEFLIBPPM) \
  134.                 $(DEFLIBPGM) $(DEFLIBPBM)
  135.         $(CC) -mD $(ALLCFLAGS) -S -o $@ -c libpnm3.c
  136. libpnm4.olr:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) rast.h libpnm4.c
  137.         $(CC) -mD $(ALLCFLAGS) -S -o $@ -c libpnm4.c
  138.  
  139.  
  140. # large data version, not registerized
  141. $(STKLIBPNM):      libpnm1.ol libpnm2.ol libpnm3.ol libpnm4.ol
  142.         -delete $(STKLIBPNM)
  143.         join libpnm1.ol libpnm2.ol libpnm3.ol libpnm4.ol to $(STKLIBPNM)
  144.  
  145. libpnm1.ol:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm1.c
  146.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpnm1.c
  147. libpnm2.ol:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm2.c $(DEFLIBPPM) \
  148.                 $(DEFLIBPGM) $(DEFLIBPBM)
  149.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpnm2.c
  150. libpnm3.ol:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm3.c $(DEFLIBPPM) \
  151.                 $(DEFLIBPGM) $(DEFLIBPBM)
  152.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpnm3.c
  153. libpnm4.ol:      pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) rast.h libpnm4.c
  154.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpnm4.c
  155.  
  156.  
  157. # Other dependencies.
  158. pnmarith pnmarith.o:            pnmarith.c
  159. pnmcat pnmcat.o:                pnmcat.c
  160. pnmconvol pnmconvol.o:          pnmconvol.c
  161. pnmcrop pnmcrop.o:              pnmcrop.c
  162. pnmcut pnmcut.o:                pnmcut.c
  163. pnmdepth pnmdepth.o:            pnmdepth.c
  164. pnmenlarge pnmenlarge.o:        pnmenlarge.c
  165. pnmfile pnmfile.o:              pnmfile.c
  166. pnmflip pnmflip.o:              pnmflip.c
  167. pnmgamma pnmgamma.o:            pnmgamma.c
  168. pnminvert pnminvert.o:          pnminvert.c
  169. pnmnoraw pnmnoraw.o:            pnmnoraw.c
  170. pnmpaste pnmpaste.o:            pnmpaste.c
  171. pnmrotate pnmrotate.o:          pnmrotate.c
  172. pnmscale pnmscale.o:            pnmscale.c
  173. pnmshear pnmshear.o:            pnmshear.c
  174. pnmtile pnmtile.o:              pnmtile.c
  175. pnmtops pnmtops.o:              pnmtops.c
  176. pnmtorast pnmtorast.o:          pnmtorast.c rast.h
  177. pnmtotiff pnmtotiff.o:          pnmtotiff.c
  178. pnmtoxwd pnmtoxwd.o:            pnmtoxwd.c x11wd.h
  179. rasttopnm rasttopnm.o:          rasttopnm.c rast.h
  180. tifftopnm tifftopnm.o:          tifftopnm.c
  181. xwdtopnm xwdtopnm.o:            xwdtopnm.c x10wd.h x11wd.h
  182.  
  183. clean:
  184.         -delete \#?.o \#?.or \#?.ol \#?.olr \#?.lib DCC_ERRORS
  185.  
  186. cleanbin:   clean
  187.         -delete $(BINDIR) all
  188.